package com.game.World.Logical;

import java.io.IOException;


/**
 * Class are factory of class Room which is return a some kind of hall from file
 * @author Max
 *
 */
public class HallCreator {
	
	public static final int HALLS_COUNT = 2;
	
	private static final String root = "bin/data/halls/";
	
	
	public static Room getHall(int k) throws IOException {
			
			String file;
			
			if (k>=HALLS_COUNT) 
				k = k % HALLS_COUNT;
			
			switch (k) {
			case 0:
				file = "hl_0.txt";
				break;
			case 1:
				file = "hl_1.txt";
				break;
			default:
				file = "hl_0.txt";
			}
			
			return new Room(root+file);
	}
		
	

}
